﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace Security.Helpers
{
    public class CursorScope : IDisposable
    {
        private Cursor currentCursor;

        public CursorScope(Cursor cursor)
        {
            currentCursor = Mouse.OverrideCursor;
            Mouse.OverrideCursor = cursor;
        }

        public void Dispose()
        {
            Mouse.OverrideCursor = currentCursor;
        }

        public static CursorScope With(Cursor cursor)
        {
            return new CursorScope(cursor);
        }
    }
}
